package org.whh.metadata.datasource.database;

import org.whh.metadata.datasource.database.pojo.DataSourceParam;

import java.sql.Connection;

/**
 * @author xiaogc
 * @version 1.0
 * @date 2021/7/14 17:34
 */
public class OracleDataSource extends DBDatasource{

    public static class OracleDataSourceBuilder extends DataSourceParam {
        private OracleDataSourceBuilder(){
        }

        @Override
        public OracleDataSource build(){
            //在这里扩展各自的属性
            OracleDataSource oracleDataSource = new OracleDataSource();
            oracleDataSource.setDatabaseName(this.databaseName);
            oracleDataSource.setPassword(this.password);
            oracleDataSource.setServerName(this.serverName);
            oracleDataSource.setPortNumber(this.portNumber);
            oracleDataSource.setUrl(this.url);
            oracleDataSource.setUser(this.user);
            oracleDataSource.setDiverName(this.diverName);
            return  oracleDataSource;
        }

    }

    public static OracleDataSource.OracleDataSourceBuilder builder(){
        return new OracleDataSource.OracleDataSourceBuilder();
    }

    @Override
    public boolean testConnection() {
        return false;
    }

    @Override
    public String buildUrl() {
        return null;
    }

    @Override
    public Connection getConnection() {
        return null;
    }
}
